package demo8;

import java.util.Arrays;

public class test {
    public static void main(String[] args) {
        int[] arr = new int[10000];
        for(int i = 0; i < arr.length; i++) {
            arr[i] = arr.length - i;
        }
        Sort sort = new Sort();
        //直接插入排序消耗的时间
        long before = System.currentTimeMillis();
//        sort.insertSort(arr);
        long after = System.currentTimeMillis();
//        System.out.println("直接插入排序：" + (after - before));


        int[] arr1 = {0,5,6,3,2,9,1,8,7,10};
        int[] arr2 = {95,91,92,90,96,92,93,92};
//        int[] arr1 = {5,2,2,1};
//        sort.shellSort(arr1);
//        System.out.println(Arrays.toString(arr1));
//        sort.selectSortFastly(arr1);
//        System.out.println(Arrays.toString(arr1));
//        //希尔排序消耗的时间
//        before = System.currentTimeMillis();
//        sort.shellSort(arr);
//        after = System.currentTimeMillis();
//        System.out.println("希尔排序：" + (after - before));
//
//        //选择排序
//        sort.selectSortSlowly(arr1);
//        System.out.println(Arrays.toString(arr1));
//        sort.selectSortFastly(arr1);
//        System.out.println(Arrays.toString(arr1));
//
//        //冒泡排序
//        sort.bubbleSort(arr1);
//        System.out.println(Arrays.toString(arr1));
//        sort.bubbleSort1(arr1);
//        System.out.println(Arrays.toString(arr1));
//
//        //堆排序
//        sort.heapSort(arr1);
//        System.out.println(Arrays.toString(arr1));

        //快速排序
        sort.countSort(arr2);
        System.out.println(Arrays.toString(arr2));
//        before = System.currentTimeMillis();
//        sort.quickSort(arr);
//        after = System.currentTimeMillis();
//        System.out.println("快速排序：" + (after - before));
    }
}
